$(function(){
	$(".form_comment").validator(
	{
		stopOnError:true,
		theme:'yellow_top',
		ignore:':hidden',
		valid:function(form)
		{
			$.fn.tips({type:'loading',content:'数据提交中'});
			$.ajax(
			{
				url:webroot+"plug/comment.asp?act=add&id="+infoid,
				type:"post",
				data:$(form).serialize(),
				success:function(data){
					data=jQuery.parseJSON(data);
					var type="warn";
					if(data.status=="y"){type="ok";}
					$.fn.tips({type:type,content:data.info});
					if(data.status=="y")
					{
						$(".form_comment")[0].reset();
						var act=data.info.substring(0,1);
						var info=data.info.substring(1);
						$.fn.tips({type:"ok",content:info});
						if(act==2)
						{
							setTimeout(function(){location.href=webroot+'plug/comment.asp?id='+infoid+'';},1500)
						}
					}
				}
			});
		}
	});
})



var startHref;
$(function(){
	
	function item_masonry()
	{
		$('.item_list img').load(function(){$('.list-loop').masonry({itemSelector:'.loop'});});
		$('.list-loop').masonry({itemSelector:'.loop'});
	}

});